#include <stdio.h>
#include "eventbus.h"


EventObject_TypeDef event1;
EventObject_TypeDef event2;
EventObject_TypeDef event3;

void event1_func1(void* pvFixedArgs, void* pvDynamicArgs) {

    printf("event1_func1\n");

}

void event1_func2(void* pvFixedArgs, void* pvDynamicArgs) {

    printf("event1_func2\n");

}

void event2_func1(void* pvFixedArgs, void* pvDynamicArgs) {

    printf("event2_func1\n");

}

void event3_func1(void* pvFixedArgs, void* pvDynamicArgs) {

    printf("event3_func1\n");

}

int main() {


    EventBus_Init();

    EventBus_CreateEvent(&event1);
    EventBus_CreateEvent(&event2);
    EventBus_CreateEvent(&event3);

    EventBus_Connect(&event1, event1_func1, NULL);
    EventBus_Connect(&event1, event1_func2, NULL);
    EventBus_Connect(&event2, event2_func1, NULL);
    EventBus_Connect(&event3, event3_func1, NULL);

    EventBus_Emit(&event1, NULL);
    EventBus_Emit(&event2, NULL);
    EventBus_Emit(&event3, NULL);

    EventBus_Run();

    EventBus_Emit(&event2, NULL);
    EventBus_Emit(&event3, NULL);

    EventBus_Run();

    printf("Hello, World!\n");
    return 0;
}
